#include <gmlib/sm9/internal/sm9_field.h>
#include <gmlib/number/uint256.h>
#include <stdexcept>
#include <cstring>
#include <gmlib/memory_utils/memdump.h>
using namespace sm9::internal;
using namespace number;

static std::uint8_t  N_SUB1_data[32]      = {0xb6,0x40,0x00,0x00,0x02,0xa3,0xa6,0xf1,0xd6,0x03,0xab,0x4f,0xf5,0x8e,0xc7,0x44,0x49,0xf2,0x93,0x4b,0x18,0xea,0x8b,0xee,0xe5,0x6e,0xe1,0x9c,0xd6,0x9e,0xcf,0x24};
#define throw memory_utils::memdump(ret_data, 32);std::printf("[%d]\n",__LINE__);throw
void test_sm9_bn_mod_n_sub1_ex()
{
    uint256_t N_SUB1;
    uint256_from_bytes(N_SUB1, N_SUB1_data);

    sm9_bn_t    ret;
    std::uint8_t ret_data[32];

    std::uint8_t num0[14] = {0x73,0xf2,0x03,0x56,0x0f,0xbe,0x09,0x5d,0x95,0xc0,0x05,0xf2,0xe3,0x90};
    std::uint8_t ret0[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0xf2,0x03,0x56,0x0f,0xbe,0x09,0x5d,0x95,0xc0,0x05,0xf2,0xe3,0x90};
    sm9_bn_mod_n_sub1_ex(ret, num0, 14);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret0, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num1[86] = {0xa9,0xc1,0x5a,0x1f,0x45,0xe6,0xca,0x58,0x02,0xcb,0x8c,0x60,0xbe,0x7c,0xfc,0x20,0x6e,0xfd,0x96,0xde,0x68,0x28,0x00,0xd0,0xc0,0xa5,0xcc,0xb1,0x73,0x94,0xdc,0xdb,0x48,0x89,0xdb,0x38,0x7d,0x8a,0xc1,0x60,0xe0,0x53,0xc1,0xe3,0x5a,0x1a,0x0c,0x64,0xa4,0x2e,0x50,0x21,0xba,0xde,0xbb,0x43,0x66,0x4f,0xbe,0x7a,0x2c,0x8b,0x9e,0x68,0x0c,0x9f,0x05,0xf8,0xe0,0x33,0x7c,0xe5,0x2a,0x97,0xcb,0x70,0x21,0xb6,0x85,0x61,0x25,0x5e,0x7e,0x2e,0x9b,0xd7};
    std::uint8_t ret1[32] = {0xab,0xfb,0xd7,0x7f,0xf0,0xff,0x8b,0x2c,0xa8,0x09,0x2e,0x28,0xad,0xbd,0x32,0xc5,0xef,0xad,0x6a,0x29,0x52,0x8a,0xf9,0xc4,0xa1,0x08,0xc6,0xb0,0x93,0xe8,0x03,0x5f};
    sm9_bn_mod_n_sub1_ex(ret, num1, 86);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret1, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num2[62] = {0x98,0x54,0x4b,0xb9,0xbe,0x41,0x24,0xe9,0x67,0x9a,0xd0,0xf8,0x81,0x85,0xed,0xe8,0x33,0xa4,0xb4,0x53,0xbb,0x67,0xfd,0x45,0x3e,0x9e,0x36,0xd7,0x07,0xde,0x57,0x33,0x0a,0x67,0xfe,0xdd,0x03,0x40,0xbb,0xa6,0xb3,0x6b,0x52,0xce,0xa2,0xdd,0x66,0x60,0xe7,0x54,0x60,0x60,0xde,0xad,0x4e,0x5a,0x85,0xca,0xa5,0x2d,0x51,0x74};
    std::uint8_t ret2[32] = {0x8f,0x66,0xda,0x1e,0x07,0x73,0x7f,0x9f,0xec,0x8f,0x35,0x09,0x45,0x9d,0x2e,0xb0,0x4d,0xf4,0xc2,0x36,0xf5,0x2f,0x09,0xb9,0x95,0xf4,0x46,0xd8,0xf3,0x57,0xd4,0x8c};
    sm9_bn_mod_n_sub1_ex(ret, num2, 62);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret2, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num3[94] = {0xab,0x08,0xd0,0x2c,0x0d,0xe2,0x71,0x0e,0x18,0x86,0x86,0xf6,0x1f,0x30,0x46,0xf4,0xd4,0xd8,0xe7,0xb9,0x73,0xdd,0x54,0x0b,0xb1,0x0d,0xb2,0x41,0xf8,0xbd,0x72,0x4d,0xac,0x49,0x12,0x9c,0x2c,0x44,0x10,0xf2,0x2d,0xf9,0x17,0x76,0x1c,0x76,0x5d,0xb2,0x28,0x94,0x8f,0x68,0x6b,0x4e,0x09,0xdf,0x9b,0x44,0xbe,0xe2,0x33,0x79,0x5f,0x41,0x32,0x80,0xc2,0x0a,0xfb,0x42,0x89,0x46,0x29,0xbb,0xe7,0xb6,0x17,0xf5,0x29,0x2e,0x47,0x39,0xf0,0x5e,0x76,0xc0,0xf4,0x80,0x7a,0x7d,0x19,0x7e,0x12,0x99};
    std::uint8_t ret3[32] = {0x8d,0x60,0x78,0x0a,0x9f,0xd7,0x44,0xad,0xc6,0x67,0x35,0xdc,0xe8,0x21,0x1b,0x59,0x75,0x69,0x44,0x90,0xe5,0x4c,0x55,0xfc,0x81,0xb2,0xe2,0x9c,0x27,0xc4,0xac,0x11};
    sm9_bn_mod_n_sub1_ex(ret, num3, 94);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret3, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num4[26] = {0x28,0x4f,0x73,0xc1,0x54,0xf8,0xa9,0xf7,0xf9,0xd6,0x4f,0x8e,0xed,0x42,0xc9,0x0c,0x01,0xeb,0x43,0xad,0xf3,0xcc,0x34,0xa0,0x14,0x11};
    std::uint8_t ret4[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x4f,0x73,0xc1,0x54,0xf8,0xa9,0xf7,0xf9,0xd6,0x4f,0x8e,0xed,0x42,0xc9,0x0c,0x01,0xeb,0x43,0xad,0xf3,0xcc,0x34,0xa0,0x14,0x11};
    sm9_bn_mod_n_sub1_ex(ret, num4, 26);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret4, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num5[42] = {0x36,0x04,0x7a,0x2a,0x70,0x96,0xab,0x71,0x19,0x90,0x4b,0x07,0x8b,0x02,0x1f,0xdc,0x3a,0x03,0xb7,0x0d,0xb8,0xbc,0x09,0x5c,0xb3,0x8e,0x01,0xb5,0x1d,0xf2,0xe7,0xf4,0xf8,0x5a,0x48,0xac,0xfb,0x46,0x06,0x9f,0x48,0x46};
    std::uint8_t ret5[32] = {0x32,0x56,0x98,0x37,0x6e,0x35,0xab,0x30,0xa8,0xe1,0x8b,0xac,0xa6,0x9b,0x56,0x5b,0xa2,0x97,0x76,0xaf,0x71,0xc4,0x84,0x55,0x15,0x56,0xe7,0x2b,0x41,0xfb,0x5b,0x36};
    sm9_bn_mod_n_sub1_ex(ret, num5, 42);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret5, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num6[43] = {0xb3,0x97,0x21,0xfb,0xb1,0x70,0xf5,0x09,0xd0,0x74,0xba,0x25,0x36,0xa4,0x83,0x6f,0x3d,0xb0,0x76,0xca,0xa3,0xd2,0xa8,0xd7,0x5a,0xc2,0xd9,0x3c,0x96,0x3d,0x34,0x6a,0xff,0x4d,0x2f,0xbf,0x1d,0xa7,0xe6,0x9c,0x81,0xe1,0xd9};
    std::uint8_t ret6[32] = {0x96,0xbb,0x45,0x95,0x16,0x22,0xa6,0xb3,0xaf,0xb9,0x39,0x6d,0x7e,0xdc,0xbb,0xf0,0x4b,0x19,0x3d,0x58,0x7d,0xe1,0x76,0x2c,0x92,0x32,0x80,0x02,0x01,0xec,0xba,0x85};
    sm9_bn_mod_n_sub1_ex(ret, num6, 43);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret6, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num7[6] = {0x0c,0x80,0xe3,0x0f,0x71,0x42};
    std::uint8_t ret7[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x80,0xe3,0x0f,0x71,0x42};
    sm9_bn_mod_n_sub1_ex(ret, num7, 6);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret7, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num8[6] = {0x08,0x69,0x74,0xe5,0x5e,0xb2};
    std::uint8_t ret8[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x69,0x74,0xe5,0x5e,0xb2};
    sm9_bn_mod_n_sub1_ex(ret, num8, 6);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret8, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num9[9] = {0xe7,0x1e,0x19,0x61,0x8b,0x53,0x1c,0x8e,0x00};
    std::uint8_t ret9[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x1e,0x19,0x61,0x8b,0x53,0x1c,0x8e,0x00};
    sm9_bn_mod_n_sub1_ex(ret, num9, 9);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret9, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num10[73] = {0xa8,0x2e,0xc9,0x51,0xf1,0x99,0xc6,0x25,0x07,0x64,0x71,0x1e,0xe0,0x5b,0xd8,0x0f,0xcb,0x79,0xf8,0x6c,0xd4,0x92,0x04,0x69,0x5c,0x6f,0x58,0x9e,0x53,0x0e,0xa2,0xc5,0x2c,0x2b,0x7f,0x95,0x9b,0x43,0x71,0x54,0x1e,0x1d,0xdf,0x6b,0x9e,0x7b,0xf9,0xe7,0xe3,0x1d,0xe7,0x0e,0x92,0x1d,0x23,0xcd,0xdb,0x68,0xab,0x72,0x15,0x15,0xfd,0xc7,0xc3,0xe0,0xff,0x69,0x3d,0x80,0x59,0xa3,0x80};
    std::uint8_t ret10[32] = {0xaf,0xcc,0x74,0x33,0x9b,0xe7,0xc3,0xd5,0xa8,0x12,0xd0,0x25,0x77,0x87,0x67,0x77,0x38,0xe2,0x1a,0x24,0x5e,0x16,0x8a,0x84,0x91,0x7b,0x00,0x75,0x5c,0xe9,0xd8,0x28};
    sm9_bn_mod_n_sub1_ex(ret, num10, 73);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret10, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num11[45] = {0x86,0x23,0xe1,0xc7,0x3f,0xf9,0xf2,0xe0,0x88,0x41,0xda,0xad,0x17,0xf8,0x73,0xcf,0xa4,0x68,0x0c,0xb1,0x19,0x23,0x36,0x70,0xf2,0xab,0x76,0x19,0xb0,0x34,0x3c,0x3f,0x36,0xde,0x44,0x62,0xef,0x44,0xd2,0x3e,0x4b,0xf2,0x1a,0x98,0xef};
    std::uint8_t ret11[32] = {0x41,0xc5,0x84,0x0e,0xaa,0x34,0x9a,0x3b,0xf4,0x1c,0xe5,0x7b,0xdb,0xc4,0x54,0x2a,0xee,0x08,0x96,0x61,0x74,0x2e,0xd1,0xa6,0x0c,0xd0,0x09,0xa9,0x14,0xd5,0x24,0xcf};
    sm9_bn_mod_n_sub1_ex(ret, num11, 45);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret11, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num12[57] = {0x5d,0x13,0xd6,0x42,0x81,0xc1,0x5e,0x94,0xf5,0x1f,0x58,0x3e,0xd2,0x37,0x82,0x43,0x58,0x62,0x39,0x77,0x99,0x96,0x78,0xa9,0x30,0x6c,0x10,0x51,0xcf,0xc4,0xac,0x1b,0xa0,0xad,0x20,0x59,0x43,0xfd,0x04,0xab,0x7c,0x3b,0x57,0xbc,0x80,0x96,0x6b,0xd4,0xe7,0x01,0x44,0xee,0xf4,0xfd,0x7d,0x22,0x12};
    std::uint8_t ret12[32] = {0x89,0xfc,0x7d,0x84,0xab,0xa1,0xd9,0x6d,0xbc,0x87,0x71,0x7a,0x1f,0x63,0x7a,0x86,0xf9,0xd2,0x4c,0x71,0xc6,0x02,0xe8,0x11,0xad,0xa8,0x12,0x49,0xbe,0x22,0x43,0xfe};
    sm9_bn_mod_n_sub1_ex(ret, num12, 57);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret12, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num13[58] = {0xd5,0x67,0x86,0x66,0x4c,0x9b,0x39,0xc8,0x68,0xf2,0x25,0x6a,0x04,0x92,0x7f,0x3e,0x13,0x97,0x79,0x26,0x25,0xd3,0xfc,0x6a,0x49,0xf7,0x28,0x76,0xaf,0x11,0xb3,0xf1,0xac,0x9a,0x68,0x03,0x53,0x08,0xcd,0x37,0xa5,0x5e,0xce,0xe7,0x39,0x97,0x1d,0xc8,0x9d,0x7f,0x16,0x4e,0x1c,0x20,0xe5,0x93,0xd3,0xe1};
    std::uint8_t ret13[32] = {0x67,0xab,0x4b,0xf0,0xe3,0x49,0x25,0xe0,0x93,0x52,0x08,0xd9,0x91,0x82,0x81,0x8f,0x67,0x4d,0x1e,0xbb,0x6a,0x92,0xf3,0xa9,0x10,0x28,0xf7,0x60,0x33,0xfb,0xae,0x21};
    sm9_bn_mod_n_sub1_ex(ret, num13, 58);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret13, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num14[7] = {0xf6,0x80,0xae,0xd8,0x6e,0x60,0x16};
    std::uint8_t ret14[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf6,0x80,0xae,0xd8,0x6e,0x60,0x16};
    sm9_bn_mod_n_sub1_ex(ret, num14, 7);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret14, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num15[55] = {0x99,0xc7,0x68,0x26,0xce,0x70,0x75,0x54,0x12,0xca,0x21,0x3e,0xb4,0x89,0xcf,0x42,0x10,0xe3,0x75,0xea,0xc0,0xd5,0x6c,0x53,0xfc,0x26,0x41,0x60,0xa0,0x5a,0x25,0x27,0x85,0xe5,0x3e,0x36,0x25,0x18,0x0d,0xcb,0x42,0x0a,0xd7,0x70,0x39,0x98,0x70,0x56,0x5e,0x92,0x32,0x3f,0xa0,0x87,0x3b};
    std::uint8_t ret15[32] = {0x6f,0xa5,0x40,0x5d,0x66,0xb0,0x6a,0x71,0x82,0x53,0x79,0x60,0xfe,0x16,0x62,0x51,0x6f,0xf5,0xbf,0x94,0x88,0xbf,0x1f,0x68,0x72,0xa3,0x9d,0xeb,0x41,0xea,0x85,0x77};
    sm9_bn_mod_n_sub1_ex(ret, num15, 55);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret15, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num16[90] = {0xad,0xb1,0x9e,0x13,0xee,0x9d,0xdb,0x8f,0x1a,0x43,0x0b,0x44,0x9f,0x62,0x62,0xd3,0x5d,0xf3,0x5b,0xd4,0x5a,0xae,0xa8,0x0a,0x73,0x0c,0x4d,0x80,0x7e,0x9f,0x53,0xed,0xa5,0x67,0x7d,0x20,0xf2,0xc2,0xe6,0x31,0x17,0xa9,0x3a,0x25,0x82,0x7c,0x2b,0x26,0x53,0xc1,0xd0,0x82,0x10,0x81,0x63,0xbe,0x7c,0x80,0x82,0x87,0x1d,0x14,0xa0,0x7e,0x42,0xb2,0x43,0x30,0xe6,0xe6,0x46,0xcf,0x35,0x46,0x6b,0x4e,0x9d,0x9b,0x83,0x66,0xe5,0x1a,0xb2,0x6e,0x24,0xb1,0x86,0xd8,0x8d,0x69};
    std::uint8_t ret16[32] = {0x3e,0xcf,0x56,0x25,0xad,0xaf,0xf0,0x82,0x7e,0x70,0xeb,0xbd,0x41,0xa5,0x7f,0xf4,0x88,0xb4,0x24,0xa4,0x3f,0x39,0x70,0xaa,0x4e,0x71,0xf5,0xb7,0xe7,0xa8,0x67,0xed};
    sm9_bn_mod_n_sub1_ex(ret, num16, 90);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret16, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num17[87] = {0xa5,0xe5,0xf5,0x0e,0x08,0x8a,0x88,0x88,0xbe,0x48,0x6c,0x80,0x12,0x87,0xb2,0xd4,0xf8,0x2c,0x2e,0xc9,0xf6,0x72,0x6e,0xf6,0xd1,0x07,0xc7,0x21,0x26,0xc6,0xe5,0xb0,0x82,0x96,0xfc,0x43,0x70,0xa3,0x4b,0x09,0x0c,0xaf,0x04,0x24,0x44,0xcd,0xc9,0xc9,0xc5,0x7a,0x1d,0xcf,0xd3,0xd9,0x79,0xd2,0x14,0x1e,0x9b,0xe5,0x9b,0x1d,0x26,0xb9,0x25,0x46,0xc0,0xe9,0x39,0x91,0xe5,0xab,0x6e,0xea,0x3b,0xc7,0xe2,0x6e,0xf4,0x45,0x79,0x64,0xc0,0x1a,0xcc,0x7d,0xdd};
    std::uint8_t ret17[32] = {0x2e,0x84,0xc7,0xe5,0xfb,0xfc,0x50,0xf1,0x86,0x9c,0xe1,0x84,0x0a,0x43,0xe9,0x17,0x80,0x80,0xc2,0xb9,0xa6,0x66,0x35,0xd0,0xa1,0x58,0xdc,0xfc,0x22,0x78,0xa0,0x09};
    sm9_bn_mod_n_sub1_ex(ret, num17, 87);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret17, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num18[19] = {0xe0,0x2b,0x1e,0x34,0xe1,0xad,0x64,0x0c,0x97,0xcc,0xe7,0x90,0xb7,0x1c,0xee,0xe9,0xfd,0xed,0x41};
    std::uint8_t ret18[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x2b,0x1e,0x34,0xe1,0xad,0x64,0x0c,0x97,0xcc,0xe7,0x90,0xb7,0x1c,0xee,0xe9,0xfd,0xed,0x41};
    sm9_bn_mod_n_sub1_ex(ret, num18, 19);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret18, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num19[57] = {0x8a,0xdf,0x93,0x67,0x6a,0xfe,0xd9,0x05,0x41,0xac,0xe9,0x62,0xcd,0x85,0x2a,0xe6,0x39,0x54,0x96,0x27,0xcf,0xde,0x89,0x12,0x91,0x99,0x1c,0xba,0xb9,0x05,0x1b,0x74,0x5c,0xab,0xdd,0x1d,0x66,0xa4,0x52,0x02,0x8b,0x11,0xa0,0xa8,0xfd,0x3e,0xbc,0x30,0xa9,0x25,0x5d,0x8d,0x67,0x93,0x76,0x81,0x00};
    std::uint8_t ret19[32] = {0x17,0x47,0x65,0xef,0xcb,0x14,0xf3,0x80,0xd8,0xbe,0x92,0x81,0xd4,0xd8,0xdf,0xa6,0xfe,0x82,0x82,0xce,0x8f,0xb3,0x5c,0xf3,0xb7,0x37,0xa2,0x0e,0xe2,0x26,0x13,0xd0};
    sm9_bn_mod_n_sub1_ex(ret, num19, 57);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret19, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num20[36] = {0x76,0xd0,0x60,0x8a,0x2a,0xfc,0x90,0x10,0x76,0x9c,0x37,0x79,0x6d,0x3a,0xa3,0x2a,0x38,0x02,0x3f,0x38,0xec,0x6d,0xd1,0xf2,0x2d,0x9e,0x8f,0xbb,0x7e,0x79,0x88,0xbb,0xd6,0xf8,0xe4,0x98};
    std::uint8_t ret20[32] = {0x01,0x44,0x15,0xfa,0xd2,0x17,0x02,0xf0,0x5c,0xfc,0x81,0x03,0xe3,0x8b,0xee,0xed,0x5e,0x21,0x84,0xd0,0xe9,0x9e,0x4b,0x3b,0x67,0x2e,0x42,0x71,0x2f,0x04,0x2a,0x18};
    sm9_bn_mod_n_sub1_ex(ret, num20, 36);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret20, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num21[70] = {0x14,0x60,0xe9,0x1e,0xe1,0x64,0xd8,0xcc,0x8e,0xa0,0x18,0xb3,0x3d,0x5c,0x57,0x8f,0x11,0xe9,0xa0,0x01,0xd3,0x16,0xd2,0x34,0x33,0xea,0xda,0x84,0x82,0x1b,0x85,0xd0,0xbb,0x6d,0x5f,0x7f,0x58,0x38,0x7c,0xe9,0x2d,0x88,0xe0,0xe9,0x64,0xfb,0xfe,0x35,0x9f,0x62,0xa0,0x6d,0x7c,0x30,0xd9,0x05,0xc1,0xea,0x55,0x0d,0x46,0x9d,0x8f,0xd8,0x82,0xd0,0x97,0xcd,0x3c,0x0b};
    std::uint8_t ret21[32] = {0x2a,0x53,0xaa,0xba,0x24,0xe8,0x19,0xe4,0x25,0xeb,0xf6,0x3e,0xdc,0x07,0x26,0x11,0xcb,0xe1,0x17,0x73,0xab,0x4f,0xdb,0x4a,0xf8,0x0a,0xdb,0xa2,0x61,0x49,0x56,0x77};
    sm9_bn_mod_n_sub1_ex(ret, num21, 70);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret21, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num22[51] = {0x36,0xe6,0xf3,0x3e,0x1a,0x53,0xd7,0xb4,0x63,0xab,0x01,0x92,0x56,0xbb,0x12,0xe7,0x98,0x4b,0x69,0x6e,0xd3,0x8a,0xf4,0x66,0xb4,0x20,0x26,0xed,0x65,0x4d,0x1a,0x6f,0x85,0x3f,0x20,0x69,0xf8,0x81,0x96,0xf8,0x3a,0x1c,0xf3,0x60,0x00,0x93,0x2d,0x17,0xb5,0x1b,0x01};
    std::uint8_t ret22[32] = {0x1c,0x37,0x49,0xcd,0x61,0x88,0x5d,0xc2,0x10,0x0b,0x74,0xaf,0x7a,0x2e,0x08,0xe3,0xba,0xd1,0x0d,0xd6,0xc3,0xff,0x97,0xbc,0xae,0x8a,0x07,0x4f,0xc9,0x85,0x4e,0x41};
    sm9_bn_mod_n_sub1_ex(ret, num22, 51);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret22, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num23[49] = {0x6e,0x0e,0xff,0x49,0x90,0x7b,0x34,0xd4,0x40,0x7d,0x39,0x5d,0xff,0xf1,0xfe,0xf5,0xd8,0xc7,0xe6,0x9f,0x91,0xd9,0xa3,0xe6,0x64,0x16,0x84,0x6e,0xbf,0x2e,0x58,0xdf,0xae,0xf2,0x3b,0x07,0x3d,0x63,0x0e,0x6c,0xc3,0x74,0xd6,0xf6,0xb7,0x89,0x6d,0x06,0x18};
    std::uint8_t ret23[32] = {0x6e,0x7a,0xae,0xf8,0x21,0x16,0x51,0x1f,0xde,0x06,0xfb,0xe3,0x61,0x0e,0x8a,0xb7,0xd0,0xc1,0xee,0x3d,0x71,0xb2,0x1b,0xc9,0x6e,0x60,0x49,0xd9,0xa2,0x06,0xbf,0x58};
    sm9_bn_mod_n_sub1_ex(ret, num23, 49);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret23, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num24[25] = {0xb3,0x3f,0x33,0xfd,0x04,0x80,0xcf,0xb6,0xbb,0xa2,0x53,0x93,0xb7,0xc9,0x7b,0x7a,0xc4,0xb5,0x03,0x31,0x34,0x88,0x99,0x4c,0x87};
    std::uint8_t ret24[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb3,0x3f,0x33,0xfd,0x04,0x80,0xcf,0xb6,0xbb,0xa2,0x53,0x93,0xb7,0xc9,0x7b,0x7a,0xc4,0xb5,0x03,0x31,0x34,0x88,0x99,0x4c,0x87};
    sm9_bn_mod_n_sub1_ex(ret, num24, 25);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret24, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num25[42] = {0x42,0x7c,0x13,0x24,0xaa,0x47,0xce,0x63,0x82,0x70,0xa3,0x98,0x4f,0x35,0x54,0x57,0x55,0x2e,0x41,0xef,0xa0,0xa7,0x30,0xf3,0x5a,0x9d,0x4b,0x0b,0xc3,0x0e,0x01,0xb2,0x87,0xe5,0x7e,0x47,0xe6,0xde,0xeb,0x59,0x29,0x6d};
    std::uint8_t ret25[32] = {0x0c,0x0a,0x22,0xee,0x7d,0x48,0xaa,0xd1,0x64,0xda,0xfb,0x7b,0xab,0x26,0x2f,0xd9,0x7f,0x20,0x0d,0x37,0x49,0x65,0xa2,0x64,0x8e,0x7a,0xfd,0x66,0x87,0xe1,0xfa,0x55};
    sm9_bn_mod_n_sub1_ex(ret, num25, 42);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret25, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num26[3] = {0xe9,0x11,0x68};
    std::uint8_t ret26[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe9,0x11,0x68};
    sm9_bn_mod_n_sub1_ex(ret, num26, 3);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret26, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num27[58] = {0xa4,0xa6,0xb6,0x75,0x99,0xe2,0xfa,0xbe,0x24,0x58,0x7b,0xc4,0xe4,0xe8,0x69,0x02,0x34,0x5d,0x09,0xc0,0xeb,0xb5,0xa4,0x9c,0x29,0xd0,0xc9,0x97,0x3d,0xe5,0xab,0x4e,0x75,0xfb,0x5b,0x4a,0x38,0x95,0x3f,0x5b,0x81,0x74,0xf6,0x20,0x1b,0xf3,0x9b,0x79,0x9a,0x27,0x5c,0x46,0xca,0x4d,0x26,0x5b,0x9b,0xf9};
    std::uint8_t ret27[32] = {0xb5,0x67,0xa1,0xb1,0xb0,0x33,0x24,0x29,0x11,0x58,0xf8,0xcd,0xa2,0xcd,0x6d,0x08,0xb4,0x2a,0xfb,0xa8,0xb6,0x33,0x9e,0xb1,0x30,0xcb,0x4e,0x35,0xa0,0xd4,0x11,0x05};
    sm9_bn_mod_n_sub1_ex(ret, num27, 58);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret27, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num28[93] = {0x08,0x23,0x8b,0x9b,0x0b,0x58,0xd3,0x51,0x04,0x26,0x7c,0xd6,0x4c,0x91,0xe6,0xb3,0xee,0xbc,0x40,0x5a,0x19,0xcf,0x70,0xbc,0x2e,0xe2,0xea,0x07,0x2b,0xab,0xa2,0x50,0x4f,0x43,0x79,0xe6,0xa7,0xb4,0x79,0x5d,0xe1,0xe6,0xc8,0xc8,0x3a,0x34,0xb1,0xf5,0x81,0x2a,0xac,0x6f,0x93,0x7e,0xd0,0x74,0x81,0x5a,0x99,0xc9,0x60,0x35,0xb7,0xeb,0xb4,0xa7,0xd1,0xcc,0x14,0xba,0xdb,0x8c,0xcc,0x25,0x68,0x33,0x88,0x87,0xef,0x14,0x5f,0x59,0x4e,0x9d,0x6a,0xfb,0x67,0x39,0x2a,0x6b,0xf6,0x30,0x1d};
    std::uint8_t ret28[32] = {0x46,0x57,0x33,0x71,0xfc,0xe8,0xac,0xc8,0x20,0x5a,0x49,0xe1,0xec,0x33,0x25,0x8a,0xbd,0x6d,0xce,0x25,0xe8,0x09,0xb0,0x62,0x59,0x84,0xc9,0xbb,0xc3,0xbb,0x5c,0x59};
    sm9_bn_mod_n_sub1_ex(ret, num28, 93);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret28, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num29[9] = {0x5d,0xf5,0x06,0x72,0x00,0x55,0x41,0x96,0xd3};
    std::uint8_t ret29[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5d,0xf5,0x06,0x72,0x00,0x55,0x41,0x96,0xd3};
    sm9_bn_mod_n_sub1_ex(ret, num29, 9);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret29, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num30[98] = {0x52,0xf6,0x14,0x8e,0xe1,0xd3,0x79,0x4f,0xe2,0x23,0x9b,0x26,0x7a,0xf4,0xe9,0x14,0xca,0x3b,0x1b,0xe8,0x94,0x15,0x58,0x9e,0x64,0x7e,0x8b,0xed,0xcb,0x56,0xf3,0xc4,0x45,0x89,0x79,0xd3,0x64,0x09,0x16,0x06,0xbe,0x97,0xa6,0x2e,0x71,0x59,0x79,0x71,0x52,0x36,0x45,0xa5,0x6c,0xc7,0xc0,0x17,0xa8,0x41,0x0b,0xb2,0x52,0x68,0xd8,0xd9,0x5f,0x6c,0x87,0xc8,0x47,0x3f,0x9f,0x8c,0x9f,0xc7,0xef,0x21,0x93,0xd1,0xd5,0x67,0xc4,0x19,0xe9,0xad,0xca,0xc4,0x11,0xd8,0x01,0x57,0x4c,0xfa,0xbf,0x57,0x1e,0x7a,0x09,0x98};
    std::uint8_t ret30[32] = {0x61,0xc5,0xc6,0x63,0x8e,0x1d,0xd9,0x05,0x8b,0xf0,0x0c,0x78,0xa2,0x7a,0x18,0x18,0x5e,0x1a,0x70,0xa5,0xa8,0xb0,0x4b,0x78,0xc4,0x18,0x62,0x9c,0x8a,0xd4,0x94,0x30};
    sm9_bn_mod_n_sub1_ex(ret, num30, 98);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret30, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num31[46] = {0x8d,0x7a,0x2b,0x4d,0x6c,0xd1,0x7c,0x4c,0x2d,0xd4,0x96,0x34,0x04,0xf7,0xde,0x1e,0x87,0xee,0x40,0xd2,0xa3,0xa7,0xb9,0xd0,0x3d,0x4e,0x09,0x46,0x40,0xb5,0x3f,0x5f,0xc1,0x1e,0x1b,0x7d,0xcc,0xb2,0x1e,0xab,0xaf,0xbe,0x4a,0xe4,0x6a,0xba};
    std::uint8_t ret31[32] = {0x10,0x48,0x89,0x5b,0x48,0xea,0xda,0x6e,0xf4,0xd1,0xe1,0xfd,0xe4,0xf9,0x75,0x34,0xed,0x5f,0x2d,0xa4,0x71,0xc9,0x96,0x72,0x1b,0x23,0xbf,0xa8,0x2d,0xe1,0x5b,0x52};
    sm9_bn_mod_n_sub1_ex(ret, num31, 46);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret31, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num32[49] = {0xc7,0x02,0x9e,0xe4,0x97,0x8f,0xfe,0x62,0xa4,0x67,0x73,0x42,0x16,0xcb,0xb2,0x36,0x47,0xd8,0xb4,0x2d,0x8c,0x63,0xe4,0xb9,0x94,0xce,0xc8,0x00,0xca,0xd5,0x07,0x9c,0x90,0xf6,0xa7,0x55,0xe2,0x45,0xc0,0x2e,0xe2,0xc1,0xa1,0xae,0xe6,0x46,0x56,0xcf,0xba};
    std::uint8_t ret32[32] = {0x0a,0xbe,0xe8,0x87,0xd0,0xec,0xf5,0xdc,0x2f,0xbb,0x04,0x44,0x8d,0x81,0xd3,0x8e,0xe1,0x27,0xca,0xd6,0x20,0xba,0x96,0xd4,0x7f,0x5a,0xe4,0x9f,0xae,0x82,0x6a,0x72};
    sm9_bn_mod_n_sub1_ex(ret, num32, 49);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret32, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num33[38] = {0x4e,0xf2,0x87,0xe2,0xe5,0x91,0xfe,0xfa,0x7f,0xf8,0x2c,0xf4,0x06,0x6d,0xb9,0xaf,0x2a,0x97,0xea,0x2a,0xf9,0x67,0x71,0x4b,0x9e,0xdb,0x77,0xb5,0xb5,0xc7,0xa1,0x53,0x5f,0x58,0x97,0xd1,0xf0,0x0d};
    std::uint8_t ret33[32] = {0x9d,0x97,0xe3,0xca,0xed,0x42,0x93,0x3b,0x9e,0x4e,0x2a,0x74,0x78,0x3a,0x86,0x14,0xfa,0x79,0xcc,0x5f,0x43,0x6c,0x83,0x64,0xfe,0x0d,0x23,0x4c,0x17,0x3c,0xd6,0x19};
    sm9_bn_mod_n_sub1_ex(ret, num33, 38);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret33, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num34[95] = {0x2b,0xa3,0xaa,0x50,0x28,0xbd,0x38,0xfe,0x6c,0x99,0x2d,0x62,0x47,0x9b,0xb8,0x39,0x20,0x10,0xce,0xaf,0xae,0xe8,0x28,0x62,0x16,0xd9,0x0d,0xc5,0xf2,0x36,0x24,0x79,0x61,0x11,0x24,0x72,0xb1,0x70,0xa1,0x78,0x41,0x1d,0xc9,0x59,0xee,0x62,0x39,0x89,0x31,0x54,0x07,0xdd,0xb8,0x3d,0x19,0xd2,0x42,0x0f,0x67,0xe2,0x73,0xee,0xc9,0xbb,0xa1,0x0a,0x9f,0x2a,0xd2,0xf5,0x11,0x81,0xbd,0x8d,0x48,0xfe,0xed,0xa1,0xea,0x41,0x0a,0x84,0xfd,0xd9,0xd2,0xa2,0xf6,0xe9,0x74,0xef,0x6d,0xb5,0x0f,0xc3,0xc2};
    std::uint8_t ret34[32] = {0xb1,0xc5,0x74,0x60,0xbe,0xa3,0x4c,0x53,0x09,0x29,0x3e,0xe3,0xa4,0xc0,0x77,0x95,0x91,0xd6,0x7e,0x15,0x8d,0x40,0x01,0xad,0xaa,0x5d,0x0d,0xd8,0x41,0x5c,0x07,0x0e};
    sm9_bn_mod_n_sub1_ex(ret, num34, 95);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret34, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num35[24] = {0xc0,0x28,0x54,0x67,0x85,0x8f,0x21,0x78,0xd3,0x11,0x7c,0xed,0x96,0x1b,0x69,0x26,0xf5,0xd0,0x41,0xfd,0x4d,0x0c,0x0a,0x58};
    std::uint8_t ret35[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x28,0x54,0x67,0x85,0x8f,0x21,0x78,0xd3,0x11,0x7c,0xed,0x96,0x1b,0x69,0x26,0xf5,0xd0,0x41,0xfd,0x4d,0x0c,0x0a,0x58};
    sm9_bn_mod_n_sub1_ex(ret, num35, 24);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret35, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num36[65] = {0x8c,0x4a,0x46,0x43,0xab,0x9a,0x44,0xd6,0x0e,0xb0,0x35,0x01,0xf5,0x70,0xf5,0xe0,0x91,0xa5,0xa3,0x68,0xfa,0xfa,0xa3,0x07,0x63,0xd5,0x76,0x2e,0xa7,0xa0,0x90,0xa0,0x67,0x28,0x8c,0xb5,0x1d,0x92,0xc2,0x88,0xa1,0x2a,0xd1,0x70,0x08,0xcb,0x0d,0x2b,0x4d,0x0a,0x39,0x22,0x0c,0x08,0xed,0x72,0xe0,0xd7,0xd2,0x70,0x59,0xb3,0x0e,0xe3,0xcd};
    std::uint8_t ret36[32] = {0x2c,0xdf,0xc2,0x1e,0xb4,0x61,0x58,0x23,0x17,0x0e,0xab,0xa1,0xde,0xab,0x34,0xa0,0x55,0xf3,0x86,0xaa,0x17,0xf8,0x8f,0x2b,0x45,0x52,0x14,0xb7,0xa9,0x4e,0x69,0xc9};
    sm9_bn_mod_n_sub1_ex(ret, num36, 65);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret36, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num37[63] = {0x74,0x32,0xde,0x78,0xcb,0x71,0x58,0xa3,0x9e,0x82,0x59,0xd8,0x95,0xf9,0x0d,0x4d,0xb1,0x1f,0x17,0xb2,0xf5,0x06,0xdc,0x78,0x0b,0xaf,0xf7,0xfc,0x1e,0xbf,0x57,0x32,0x49,0x2b,0xb8,0x7d,0xf1,0x64,0x22,0x6c,0xab,0x93,0xdf,0xc4,0x43,0x2a,0xaa,0xd0,0x0f,0xbd,0xac,0xd9,0x67,0x40,0x66,0xfb,0x4b,0x61,0x47,0xf7,0xe2,0x31,0x81};
    std::uint8_t ret37[32] = {0x3a,0x99,0xa4,0x2b,0x3a,0xc1,0xdc,0x0b,0xbf,0x37,0x41,0xf7,0xfb,0xa1,0x5e,0xc2,0x3c,0xb2,0x43,0x57,0xb5,0xd1,0x03,0x47,0x54,0x80,0xde,0x68,0xb3,0xc7,0x4f,0x39};
    sm9_bn_mod_n_sub1_ex(ret, num37, 63);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret37, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num38[4] = {0xc3,0x0b,0x63,0xc2};
    std::uint8_t ret38[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc3,0x0b,0x63,0xc2};
    sm9_bn_mod_n_sub1_ex(ret, num38, 4);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret38, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num39[39] = {0x8f,0x7d,0x7f,0x04,0x65,0xc6,0x74,0x79,0x44,0x3b,0x59,0x57,0x9d,0x53,0x2d,0x7d,0x38,0x26,0xaa,0x79,0x66,0x7e,0x60,0x9f,0x55,0x5f,0x94,0xe8,0x60,0x85,0x61,0x45,0xf3,0x16,0xa0,0x81,0xe1,0xcb,0x4c};
    std::uint8_t ret39[32] = {0x4c,0x88,0xbf,0x06,0x56,0x6a,0x86,0x06,0xb0,0xd4,0x9d,0x64,0xdb,0x55,0xeb,0xd3,0xf2,0xe6,0xd8,0xc1,0xf4,0x1a,0xf9,0x11,0xb9,0x5b,0xc8,0x6d,0x4f,0x25,0xa9,0x10};
    sm9_bn_mod_n_sub1_ex(ret, num39, 39);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret39, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num40[96] = {0xf9,0x37,0x68,0x85,0xf0,0x59,0xba,0xe2,0xc3,0xf9,0x05,0xe5,0x23,0xc5,0x05,0xc6,0xa4,0x47,0xbc,0x68,0xd7,0x9b,0xec,0x25,0xbc,0xa6,0x1c,0xcf,0x48,0x66,0x76,0x55,0x19,0xe2,0x26,0xce,0x94,0x9b,0x07,0x32,0x63,0x54,0x09,0x83,0x91,0xb0,0x3b,0x62,0x8e,0x74,0x5a,0xe4,0x04,0x2e,0x3d,0x42,0x32,0xce,0x08,0x19,0x84,0x9e,0xf4,0x2a,0xad,0x77,0xab,0x78,0x9a,0x2f,0x75,0x08,0x90,0x4d,0x5c,0xa0,0x51,0xae,0x02,0x8e,0x76,0x53,0x49,0xb0,0x75,0x4e,0xaa,0x95,0xc6,0x3e,0x88,0x70,0x61,0x67,0x47,0x8d};
    std::uint8_t ret40[32] = {0x60,0x85,0xc3,0xa9,0x11,0x0f,0xa6,0x8c,0x2a,0x2a,0x69,0xd5,0x6b,0xb0,0x7b,0x3b,0x13,0xee,0xe5,0xdb,0xa6,0x77,0xc8,0xd2,0x32,0xf9,0xc7,0x1f,0x67,0x4b,0x46,0xfd};
    sm9_bn_mod_n_sub1_ex(ret, num40, 96);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret40, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num41[100] = {0x1b,0x50,0xf0,0xfd,0x8a,0x13,0xe8,0x01,0x6b,0x0a,0xb9,0xdb,0x38,0xd3,0xf5,0xea,0x52,0x4a,0xdd,0xf3,0xdb,0x39,0xeb,0x47,0x1d,0xf3,0xb2,0x0c,0x26,0x68,0x39,0xce,0xb2,0x12,0x6f,0x67,0x57,0x7b,0xa2,0xff,0x90,0x52,0x20,0xd8,0x0d,0x81,0x1f,0x3e,0xa3,0xf3,0x8a,0xf9,0x24,0xea,0x64,0xa9,0xed,0x85,0x23,0x97,0x98,0x38,0x14,0x9a,0xbe,0x81,0x0f,0x82,0x72,0x50,0x9e,0x0a,0x14,0x05,0xa9,0xd3,0x93,0x59,0xe1,0xc7,0x69,0x59,0xcf,0xcb,0x62,0x1f,0x5a,0xad,0x36,0x46,0x24,0x82,0x3d,0xc2,0xec,0x4f,0x65,0xeb,0xb6,0xeb};
    std::uint8_t ret41[32] = {0x97,0xb5,0x41,0xe4,0xe3,0x89,0x76,0x29,0x0d,0x59,0x20,0x57,0xe2,0x2d,0x7e,0x25,0xb5,0x86,0x17,0x38,0x49,0xfa,0xa6,0x96,0x59,0x4f,0xc9,0x37,0x8d,0xed,0x45,0x03};
    sm9_bn_mod_n_sub1_ex(ret, num41, 100);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret41, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num42[24] = {0xb7,0x5f,0x2b,0x59,0x71,0xe9,0xca,0xb7,0xaa,0xb4,0xa9,0x63,0xa1,0xbf,0xee,0xff,0x72,0x39,0xb5,0x17,0x41,0xb4,0x28,0xbd};
    std::uint8_t ret42[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb7,0x5f,0x2b,0x59,0x71,0xe9,0xca,0xb7,0xaa,0xb4,0xa9,0x63,0xa1,0xbf,0xee,0xff,0x72,0x39,0xb5,0x17,0x41,0xb4,0x28,0xbd};
    sm9_bn_mod_n_sub1_ex(ret, num42, 24);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret42, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num43[4] = {0xb7,0x87,0xc6,0xea};
    std::uint8_t ret43[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb7,0x87,0xc6,0xea};
    sm9_bn_mod_n_sub1_ex(ret, num43, 4);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret43, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num44[99] = {0x8b,0xbd,0xa6,0x78,0x7b,0xb9,0x3b,0xa9,0x77,0xde,0xb7,0x9a,0xc4,0x26,0x5f,0x91,0x1d,0x1a,0x88,0xf3,0x7a,0xb8,0xb1,0xc6,0x1e,0x68,0x69,0x3d,0xd4,0x58,0x3e,0x84,0x25,0x99,0xa0,0x15,0xa9,0x72,0xc0,0x30,0x6e,0x96,0xb0,0xa4,0x08,0x6c,0xb0,0x30,0x74,0x35,0x98,0xa4,0xc1,0xca,0xaf,0xc1,0x2b,0x18,0x64,0x8c,0x36,0x06,0x02,0xc8,0xa3,0xa3,0x1d,0x38,0x4d,0xc7,0xdf,0x00,0x34,0x6e,0xc4,0x89,0x00,0x88,0xdc,0x10,0x34,0x78,0xe4,0x58,0xce,0x6a,0x35,0x1d,0x62,0x7a,0x1e,0x7e,0xe7,0xfe,0x33,0x1b,0xa6,0x2d,0xeb};
    std::uint8_t ret44[32] = {0x73,0xf0,0xa7,0x02,0x4e,0xb2,0xbe,0xcd,0x2a,0x11,0xbb,0x2c,0x33,0xce,0x80,0xb1,0x21,0x53,0x71,0x34,0x70,0xed,0xdc,0x92,0x8f,0x4d,0x09,0xab,0xcc,0xe0,0xbe,0xb3};
    sm9_bn_mod_n_sub1_ex(ret, num44, 99);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret44, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num45[55] = {0xa6,0x99,0x99,0x0c,0x74,0x8f,0xed,0xf8,0xea,0xd9,0x8e,0x5c,0x3f,0xd9,0x1e,0x7d,0x38,0xd9,0x90,0x8d,0xb6,0x9f,0x42,0xff,0x4a,0x2f,0x33,0x4f,0x18,0xf6,0xaa,0xd0,0xa0,0x93,0xdd,0x2a,0xa1,0xf3,0xf5,0x33,0x5c,0x12,0xaf,0xe8,0xa8,0x5c,0x22,0x1f,0xd3,0x91,0x39,0x40,0x40,0xb9,0x5c};
    std::uint8_t ret45[32] = {0xb5,0xac,0x8d,0x39,0x41,0x32,0xd2,0xc8,0x68,0x59,0xf6,0x06,0x69,0x0f,0xcf,0x66,0xca,0xe3,0x13,0xfe,0xa8,0x04,0x00,0xef,0x48,0x41,0xe8,0xbe,0x1c,0x95,0x04,0x9c};
    sm9_bn_mod_n_sub1_ex(ret, num45, 55);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret45, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num46[63] = {0xa8,0xd1,0xaa,0xdc,0x37,0xd6,0x33,0x00,0x1e,0x1d,0x5d,0x52,0x14,0xcb,0x33,0x38,0xc0,0xa8,0xec,0x32,0x62,0xee,0xd8,0x88,0x52,0x6a,0x50,0x6f,0x7b,0xa0,0xd0,0xea,0xdd,0x6c,0xa9,0xb7,0x4a,0xb7,0xad,0xec,0x50,0xdb,0xc7,0x04,0x0a,0x02,0x8f,0x12,0x6a,0x28,0x3e,0xf2,0x42,0xe4,0x71,0xb0,0xf3,0xbb,0x25,0xdd,0x3b,0x11,0x9a};
    std::uint8_t ret46[32] = {0x33,0x6e,0xa6,0xb9,0xe3,0x03,0xe1,0xaa,0xae,0xde,0x5f,0x23,0x92,0x12,0xc5,0xc9,0xd0,0xb7,0xcf,0x49,0xce,0x06,0x70,0x2f,0xec,0x4c,0x96,0xf3,0x40,0xa2,0x67,0x86};
    sm9_bn_mod_n_sub1_ex(ret, num46, 63);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret46, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num47[50] = {0x3d,0x1b,0xd0,0xa1,0xcf,0x34,0xa1,0xbd,0xdc,0xea,0xd8,0xf2,0x66,0x2e,0xff,0x37,0x01,0x1b,0xbb,0x45,0x45,0x43,0xa4,0x40,0x82,0xc0,0x6f,0x68,0x9f,0x1b,0x64,0xc5,0xbc,0xa4,0xb5,0xe3,0x78,0x07,0x77,0x7b,0x0c,0xa8,0x9a,0xd8,0xca,0x61,0xfb,0xfd,0x12,0x15};
    std::uint8_t ret47[32] = {0xa3,0x9f,0xfe,0x7d,0x7a,0x4a,0xd0,0xb6,0x7a,0xe5,0x89,0x73,0x00,0x91,0xc3,0xf8,0x9d,0xd9,0x51,0x71,0xd5,0x0b,0x42,0xba,0x25,0xbf,0xf6,0xab,0x96,0xf8,0x11,0x21};
    sm9_bn_mod_n_sub1_ex(ret, num47, 50);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret47, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num48[54] = {0x3c,0x2e,0xef,0x7a,0x41,0xc8,0x8d,0x1a,0x31,0x0e,0x69,0x23,0x9e,0xf2,0x07,0x07,0x54,0x76,0x28,0xab,0xb7,0xd0,0xfe,0x65,0xce,0x63,0x78,0x5f,0x0e,0xcd,0xa0,0x58,0xdb,0xdb,0xa1,0xa2,0xf9,0x10,0x67,0xf0,0x4b,0xbc,0x96,0xc0,0x9a,0xca,0xc0,0x43,0xd6,0x46,0xd1,0x2a,0xb8,0x9c};
    std::uint8_t ret48[32] = {0x3a,0x5e,0x1f,0x82,0xa4,0x3e,0x16,0x04,0x03,0x5d,0xa7,0x07,0x77,0xcb,0xc7,0x2d,0x72,0x38,0x23,0x39,0x90,0xf5,0xe6,0xd4,0xc7,0x72,0x7f,0x72,0x72,0x16,0x14,0x64};
    sm9_bn_mod_n_sub1_ex(ret, num48, 54);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret48, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num49[69] = {0x1d,0xcb,0xc0,0x10,0x87,0x90,0xd1,0x56,0x42,0x4c,0x89,0x5c,0xcf,0xd3,0x96,0x76,0x68,0x3d,0x2e,0xe9,0xf0,0x19,0x31,0xd4,0xf5,0x18,0x76,0x6a,0xe1,0x04,0x58,0xc7,0x6e,0x24,0xca,0xce,0x56,0xa3,0x01,0x83,0x35,0xf1,0x75,0xe9,0x7a,0x53,0x03,0xce,0xba,0x56,0xf9,0x49,0x68,0x77,0xfd,0x88,0x83,0x2c,0x05,0x83,0xd2,0x67,0x1d,0xc7,0x79,0xa4,0xc8,0x40,0x00};
    std::uint8_t ret49[32] = {0xaa,0xff,0x02,0xf8,0x3b,0x4e,0xf3,0x27,0x99,0x40,0x37,0x60,0xe7,0x3a,0xdd,0x49,0xb1,0x93,0x6b,0x34,0xfb,0x57,0xed,0x9f,0x04,0x83,0xcb,0xce,0xbb,0x4f,0x5a,0x18};
    sm9_bn_mod_n_sub1_ex(ret, num49, 69);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret49, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num50[51] = {0xda,0x11,0x08,0xa5,0x07,0x22,0x82,0x56,0x96,0xe8,0xfc,0xb1,0x66,0xd3,0xbd,0x59,0x3d,0xf2,0x8b,0x82,0x45,0x5a,0x4d,0x4a,0x7d,0x5c,0x14,0x25,0xd0,0xe6,0x90,0x10,0x97,0xdd,0x0f,0x9b,0x6f,0x85,0x19,0xc6,0x9d,0x51,0xe8,0x10,0x30,0x5d,0xef,0x7a,0xfc,0x71,0xdd};
    std::uint8_t ret50[32] = {0x26,0x03,0x7d,0xb1,0x1f,0x5c,0x04,0x64,0x1e,0xfc,0x28,0x25,0xbd,0x45,0x33,0x87,0xec,0xa9,0x64,0x93,0xfe,0xb6,0x3d,0xfc,0x65,0xfb,0xac,0x39,0xa3,0xd9,0xe5,0x0d};
    sm9_bn_mod_n_sub1_ex(ret, num50, 51);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret50, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num51[3] = {0x7a,0xa4,0xf1};
    std::uint8_t ret51[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7a,0xa4,0xf1};
    sm9_bn_mod_n_sub1_ex(ret, num51, 3);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret51, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num52[87] = {0xe7,0xed,0x31,0xbe,0x7e,0xe5,0x47,0x5d,0xb4,0x2d,0x7d,0xc6,0xc2,0x73,0xc7,0xd9,0xc5,0xa1,0x3e,0xe5,0x25,0x55,0x0a,0xee,0xdd,0xbf,0x6d,0x93,0x1d,0x12,0x61,0x00,0x3d,0x9e,0x90,0x81,0x73,0xb4,0xb7,0x37,0x68,0x66,0x4b,0x79,0x88,0x64,0x85,0x47,0x8d,0x88,0xd5,0x91,0xd6,0x2c,0x8f,0x43,0xd3,0x0d,0x91,0xc5,0xde,0x62,0xe9,0xe2,0x38,0x5e,0x02,0xc1,0x25,0x9e,0x14,0x6f,0xdb,0x74,0x9f,0xd0,0xee,0x5a,0x9e,0xa1,0x50,0x76,0x8e,0x57,0x0c,0x14,0x87};
    std::uint8_t ret52[32] = {0x4f,0x40,0x71,0x2a,0xcb,0x1c,0xa5,0x00,0xc8,0x3f,0x46,0x5f,0xa8,0xbf,0xd7,0xdc,0x25,0x4b,0x10,0x65,0xc0,0xb5,0xa1,0xa1,0x26,0x40,0x05,0x7c,0x89,0xd4,0x94,0x6b};
    sm9_bn_mod_n_sub1_ex(ret, num52, 87);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret52, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num53[67] = {0xd5,0x0b,0x36,0x75,0x91,0xfb,0x6a,0xbd,0x83,0xa7,0x22,0x1d,0x5e,0x1f,0x87,0xf6,0xc0,0x16,0x8c,0x27,0xf2,0x8e,0x6b,0x30,0x84,0x39,0x24,0x34,0xd2,0x17,0x2d,0x6b,0x1d,0xb4,0x3c,0xea,0xbb,0xa7,0x35,0x9b,0x2b,0xdf,0x61,0x79,0x54,0x1e,0xcb,0xa0,0xb3,0x37,0x5d,0xee,0xfe,0xae,0x9c,0x5d,0x76,0xed,0xa4,0x40,0x93,0x23,0x03,0xb5,0xb9,0x8b,0x04};
    std::uint8_t ret53[32] = {0x4d,0x9a,0x7d,0x72,0x02,0x65,0x93,0x4f,0xed,0xa1,0x3d,0x14,0x7a,0x79,0x21,0x41,0x4c,0x22,0xcf,0xca,0xbf,0x10,0xa5,0x06,0x01,0xef,0xfd,0x4c,0xb0,0x57,0xe1,0xd0};
    sm9_bn_mod_n_sub1_ex(ret, num53, 67);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret53, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num54[18] = {0x5f,0xa9,0xe3,0xe7,0x4f,0xaf,0x53,0x8e,0x4e,0x23,0x06,0x5f,0x74,0x42,0xda,0x73,0x06,0xca};
    std::uint8_t ret54[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0xa9,0xe3,0xe7,0x4f,0xaf,0x53,0x8e,0x4e,0x23,0x06,0x5f,0x74,0x42,0xda,0x73,0x06,0xca};
    sm9_bn_mod_n_sub1_ex(ret, num54, 18);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret54, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num55[86] = {0xc2,0xf8,0xda,0x13,0x04,0x85,0x90,0xc1,0x86,0xb8,0x7d,0x5a,0x8a,0xbe,0x07,0xb5,0xb5,0x60,0xfe,0x84,0x96,0x6f,0x9b,0x41,0xd5,0x9d,0xd5,0x42,0x95,0x79,0x75,0xe0,0x81,0x78,0x46,0xac,0x2c,0xca,0xa6,0x4b,0x98,0xb5,0x46,0x3d,0x83,0x28,0x0b,0x15,0x16,0x6e,0x0f,0x0e,0x31,0x91,0x19,0x57,0x01,0xd1,0x01,0x14,0x22,0xb3,0x9f,0xcf,0xd7,0x82,0x0b,0x5a,0x56,0xc5,0xbb,0x31,0x58,0x9b,0x13,0x9e,0x8f,0x4a,0x42,0x38,0x3b,0x43,0xd8,0x32,0x8a,0x7c};
    std::uint8_t ret55[32] = {0x91,0x7f,0xe9,0x56,0x15,0x14,0xc3,0xdb,0xa0,0x96,0x4c,0xbd,0x30,0x49,0xa3,0xeb,0xcf,0xb7,0x68,0x79,0x28,0xbc,0xe5,0xcd,0xe6,0x73,0x54,0xc2,0xe4,0xc8,0x61,0xb8};
    sm9_bn_mod_n_sub1_ex(ret, num55, 86);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret55, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num56[89] = {0x35,0x7c,0xb0,0xc3,0x48,0x8a,0x9d,0x1f,0x86,0x89,0xda,0xd3,0xd7,0xa6,0x09,0x10,0x12,0x46,0x0d,0xc6,0x36,0x27,0xa8,0x3f,0xa1,0x4c,0xe2,0x7b,0x91,0x8d,0x0b,0xd5,0x0f,0x7d,0x8a,0x7a,0x68,0x08,0x5a,0xd5,0x75,0xc7,0xc0,0x3c,0x73,0x5d,0xc5,0x73,0x1d,0xa9,0x48,0x4e,0x36,0x4b,0x61,0x92,0x14,0x25,0x17,0xda,0xb8,0x48,0x90,0x32,0x0c,0x06,0x02,0x40,0x69,0x87,0xbd,0x60,0x69,0x1e,0xa8,0xc0,0x46,0xf7,0xdf,0xd3,0x0c,0x1a,0x98,0xde,0x03,0x4d,0x53,0x0d,0xd8};
    std::uint8_t ret56[32] = {0x20,0xe6,0x18,0x2b,0x48,0x3d,0xbb,0x55,0x61,0x2e,0xb0,0x19,0xb5,0x37,0xd7,0x79,0x71,0xf1,0x16,0xe8,0x35,0x0b,0x32,0xb7,0x37,0x3c,0x26,0x6c,0x45,0xe9,0xf4,0x34};
    sm9_bn_mod_n_sub1_ex(ret, num56, 89);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret56, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num57[42] = {0x4d,0x34,0x33,0xd5,0x84,0x19,0x11,0x80,0x06,0x4e,0x1a,0x3b,0x3c,0xec,0xef,0x18,0x8e,0x88,0x3c,0x82,0x4f,0x94,0x51,0x24,0xbb,0x66,0x13,0xa4,0xc8,0x0b,0xac,0x67,0xaa,0xb6,0x82,0x85,0x96,0x15,0x71,0x56,0xb8,0x23};
    std::uint8_t ret57[32] = {0x78,0x89,0x20,0xe5,0x49,0x6c,0x10,0x6f,0x28,0xce,0x0d,0x75,0xe7,0x25,0x41,0x88,0x43,0x51,0xb7,0xec,0x25,0xee,0xd7,0x1b,0x45,0xff,0xe8,0x62,0x6a,0x1f,0x2f,0xdb};
    sm9_bn_mod_n_sub1_ex(ret, num57, 42);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret57, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num58[6] = {0xad,0x90,0x97,0xda,0x56,0xc0};
    std::uint8_t ret58[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xad,0x90,0x97,0xda,0x56,0xc0};
    sm9_bn_mod_n_sub1_ex(ret, num58, 6);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret58, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num59[87] = {0x5f,0xa1,0x31,0x91,0xeb,0xb3,0x9d,0x71,0x17,0x5f,0xa1,0xc7,0xe4,0xd6,0x0c,0x9b,0xd8,0xfa,0x9b,0xa9,0x2e,0x9e,0xf4,0x5a,0x4d,0x5f,0x44,0x8d,0x55,0xb0,0x0a,0x0d,0xf3,0x25,0x28,0xf2,0x28,0x18,0x5e,0xca,0x98,0x94,0x0e,0xc0,0xe9,0xde,0x1a,0x6d,0x28,0x5e,0xf5,0xf1,0xb3,0x7c,0x8c,0x8c,0x95,0xc3,0x08,0x8d,0xdb,0xce,0xe1,0x55,0x28,0x39,0x90,0x85,0x93,0xed,0x12,0x2c,0x93,0x50,0x6c,0x87,0x73,0x44,0xde,0xca,0x9a,0x8b,0x23,0x92,0x32,0x40,0xc3};
    std::uint8_t ret59[32] = {0x7f,0x6c,0xce,0x5b,0xcf,0xda,0x36,0xfc,0x1a,0x47,0x83,0x35,0xf8,0x80,0xdb,0xb5,0x0b,0x63,0xd8,0xcc,0x26,0x40,0x22,0x5b,0x1b,0xb9,0x33,0x9a,0x8a,0x4c,0xc9,0x7b};
    sm9_bn_mod_n_sub1_ex(ret, num59, 87);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret59, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num60[71] = {0x1f,0xe0,0xbb,0xf7,0xe0,0x54,0x49,0x27,0x92,0x53,0xf3,0xae,0xf3,0xd3,0xf0,0x7d,0xa2,0xd7,0x6e,0x59,0x2d,0x45,0x49,0x3f,0x21,0x09,0x26,0xb9,0x40,0x73,0x08,0x01,0x4c,0xd5,0x31,0x04,0x41,0x01,0x11,0xd1,0x50,0x80,0x21,0xea,0x32,0xa0,0x3e,0x8b,0x48,0xe7,0x4f,0xe0,0x83,0x77,0xaf,0x80,0x57,0x29,0x88,0xcc,0xfa,0x0c,0xb7,0x01,0x1f,0xfd,0x94,0xa5,0x8e,0x15,0xd2};
    std::uint8_t ret60[32] = {0x42,0x57,0xbe,0xdb,0x1a,0xb3,0xe2,0x05,0xfa,0x9f,0xb6,0x03,0x52,0x84,0x29,0x71,0xa2,0x4d,0xef,0x61,0x3a,0xbd,0x86,0x71,0xa7,0xe7,0xdb,0xcd,0x8f,0x0f,0xbf,0xa6};
    sm9_bn_mod_n_sub1_ex(ret, num60, 71);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret60, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num61[86] = {0xb9,0x23,0x72,0x59,0x7f,0x2e,0x7a,0xfc,0xb6,0xff,0x02,0x9d,0x1a,0x9e,0x70,0x45,0xc5,0x17,0x9d,0xbb,0x21,0x1b,0xb6,0x35,0x31,0x5e,0x0e,0xb8,0x8f,0x58,0x19,0xb0,0xb2,0x6a,0x6d,0xd8,0x5c,0xb0,0xbd,0x71,0x6c,0xba,0xf1,0xa6,0x89,0xd0,0x3a,0x72,0x53,0x0c,0x54,0x42,0xba,0xa2,0x02,0xc5,0x00,0xb7,0xd5,0x33,0xb0,0x78,0x41,0xef,0x17,0x1e,0x4e,0xb3,0x7f,0xbf,0x12,0x2a,0x47,0xd2,0xf8,0x5f,0xf3,0x1d,0xbb,0x77,0x3d,0x16,0x75,0x28,0xea,0x91};
    std::uint8_t ret61[32] = {0x2c,0x26,0xae,0x5e,0x53,0x39,0x84,0xd1,0x42,0xbf,0xc3,0x02,0xb8,0xfa,0x12,0x3a,0x9c,0xe5,0x24,0xb1,0xe1,0x52,0xca,0x0f,0x66,0x2e,0xe2,0xd4,0x04,0xd9,0x9e,0xc9};
    sm9_bn_mod_n_sub1_ex(ret, num61, 86);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret61, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num62[22] = {0xdd,0x5f,0x6d,0x0c,0x36,0x1b,0x03,0x7a,0x26,0x77,0x2d,0x17,0xed,0xf7,0x19,0x3a,0xae,0xb6,0x4e,0x69,0x0a,0x0a};
    std::uint8_t ret62[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xdd,0x5f,0x6d,0x0c,0x36,0x1b,0x03,0x7a,0x26,0x77,0x2d,0x17,0xed,0xf7,0x19,0x3a,0xae,0xb6,0x4e,0x69,0x0a,0x0a};
    sm9_bn_mod_n_sub1_ex(ret, num62, 22);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret62, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num63[92] = {0x0b,0x62,0xf5,0xc4,0x8a,0x5f,0x88,0x01,0x4a,0xd0,0x73,0x41,0x12,0x39,0x4c,0xa8,0x37,0x44,0x02,0xc0,0x10,0x00,0x92,0xb7,0xea,0x1a,0x97,0x31,0x6c,0x99,0xba,0x94,0x0f,0x75,0x2c,0x0c,0x93,0x28,0x6e,0xfb,0x8c,0x2f,0xf1,0x84,0x7b,0x03,0x8e,0x45,0x82,0x6a,0x1a,0x65,0x86,0x84,0x62,0xb7,0xd1,0x98,0x5c,0x7d,0x0f,0x8d,0xc1,0xb7,0xea,0x32,0x7d,0x7e,0x34,0x67,0x11,0x50,0x7c,0xf8,0x37,0xe5,0x16,0xd1,0x2a,0x39,0xd7,0xc5,0xcc,0xb9,0x76,0xa4,0x74,0xee,0x6f,0x10,0x5d,0x73};
    std::uint8_t ret63[32] = {0x04,0xcf,0x8b,0xbb,0x89,0xe7,0xe7,0x45,0xdb,0x78,0xf2,0xc8,0xb0,0xb0,0x17,0x29,0xf9,0x53,0x79,0x6e,0xa5,0xa3,0x29,0x9e,0xcd,0xd4,0x0d,0x95,0xd4,0x35,0xf3,0xd3};
    sm9_bn_mod_n_sub1_ex(ret, num63, 92);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret63, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num64[70] = {0xbc,0xba,0xf0,0xfc,0xa2,0x5e,0x71,0xf0,0xd6,0x48,0xb2,0xdf,0x72,0xec,0x13,0x72,0x30,0x6e,0x79,0x18,0xe7,0x19,0x9f,0x10,0x79,0x57,0xa1,0x53,0x5a,0xfa,0x5d,0xd4,0x74,0xd7,0x05,0x6b,0x95,0xc8,0x92,0x0e,0x45,0x6e,0x78,0x41,0xac,0x3e,0x8b,0x2f,0x87,0x46,0x78,0x67,0xfd,0x43,0x26,0x16,0x8e,0x7f,0x9d,0x26,0xa4,0x42,0x55,0x2a,0x89,0xdd,0x33,0x1b,0x3a,0xf7};
    std::uint8_t ret64[32] = {0x8b,0x96,0xae,0xf9,0xd2,0xfe,0x97,0x43,0xb9,0x2f,0x77,0x84,0x2e,0x6e,0x7e,0x64,0xc2,0x60,0x0a,0x82,0x7c,0x43,0xe7,0x24,0xb2,0x97,0x9a,0xdb,0xbf,0x81,0x0d,0x3b};
    sm9_bn_mod_n_sub1_ex(ret, num64, 70);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret64, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num65[35] = {0x02,0xe6,0xdb,0x15,0x72,0x2d,0x8c,0x89,0xd2,0x76,0xe3,0x3f,0xcd,0x42,0x6d,0x5a,0xef,0x4f,0x4b,0x8d,0x5d,0x0f,0xda,0x11,0xb9,0xdc,0x5e,0xd3,0x68,0xc0,0x62,0xb1,0xa3,0xf8,0x02};
    std::uint8_t ret65[32] = {0x53,0xf2,0x22,0xca,0x91,0x38,0x38,0x79,0xa7,0x25,0x86,0x1d,0x75,0x44,0x3c,0x8a,0x29,0x72,0x34,0xb8,0xfd,0x7f,0x0b,0x7e,0x51,0x1a,0xc3,0xae,0xbe,0x80,0xd1,0x6a};
    sm9_bn_mod_n_sub1_ex(ret, num65, 35);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret65, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num66[3] = {0x61,0x42,0x25};
    std::uint8_t ret66[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0x42,0x25};
    sm9_bn_mod_n_sub1_ex(ret, num66, 3);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret66, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num67[93] = {0xde,0x53,0x77,0x6f,0x86,0x0a,0x87,0x3f,0xd0,0xfe,0xab,0xf8,0x36,0x59,0x35,0x19,0x46,0x1d,0x8d,0x00,0x15,0xca,0x9e,0xd3,0x2d,0xcd,0x46,0x8a,0x3e,0xac,0x72,0x01,0x12,0x62,0xe1,0xe7,0xc7,0x23,0x0a,0xc5,0xf6,0x6e,0x0f,0xa6,0xd5,0x5f,0xd7,0x46,0x5d,0x60,0x1f,0x49,0x13,0x53,0x01,0x5f,0xce,0x05,0xf5,0x49,0xfe,0xb4,0x6c,0xf9,0x1c,0xf9,0xf5,0x17,0xdd,0xa5,0x45,0x79,0x29,0xe9,0x10,0x2c,0x6d,0xa4,0x3f,0x46,0xe3,0x96,0x67,0x43,0x93,0x52,0xc3,0x59,0xbb,0x93,0x07,0x8a,0xcc};
    std::uint8_t ret67[32] = {0x2f,0xa3,0x54,0x6b,0xa6,0x56,0x29,0x90,0x6f,0x89,0xc2,0xc7,0x25,0x3d,0x58,0x17,0x56,0x44,0x8c,0xa7,0xe8,0xab,0x97,0x6b,0x2f,0xca,0x3b,0x2e,0xea,0xe3,0x6e,0xf4};
    sm9_bn_mod_n_sub1_ex(ret, num67, 93);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret67, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num68[52] = {0x61,0x92,0x72,0x56,0x33,0x02,0x88,0xfd,0xde,0xbc,0xc8,0xff,0x5c,0x90,0xf6,0xfd,0x94,0x19,0x68,0xe0,0x51,0x2c,0xf9,0xf5,0x97,0x0b,0x4f,0xcb,0x31,0x9d,0x7e,0x70,0x72,0x49,0x0f,0xb5,0xaf,0xd5,0xa8,0x12,0xa9,0x88,0x83,0x40,0xf7,0xab,0x5d,0x80,0xd4,0x9b,0xe4,0x95};
    std::uint8_t ret68[32] = {0x82,0xa8,0xcd,0xb5,0xb1,0x3b,0x70,0x9f,0x75,0xbb,0x0a,0x0c,0x38,0xdd,0xf5,0xa7,0xa0,0x88,0x5d,0x29,0x21,0x60,0xcf,0xbd,0x9b,0x71,0x60,0x6a,0xf7,0xe8,0x4e,0x55};
    sm9_bn_mod_n_sub1_ex(ret, num68, 52);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret68, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num69[30] = {0xea,0x70,0x1f,0xab,0x2d,0xb5,0x9d,0x49,0x75,0xce,0xaa,0xde,0x60,0x09,0x3c,0x88,0x28,0xe6,0xd2,0x18,0x26,0xc1,0x4c,0x54,0x05,0x87,0xa5,0x17,0x97,0x03};
    std::uint8_t ret69[32] = {0x00,0x00,0xea,0x70,0x1f,0xab,0x2d,0xb5,0x9d,0x49,0x75,0xce,0xaa,0xde,0x60,0x09,0x3c,0x88,0x28,0xe6,0xd2,0x18,0x26,0xc1,0x4c,0x54,0x05,0x87,0xa5,0x17,0x97,0x03};
    sm9_bn_mod_n_sub1_ex(ret, num69, 30);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret69, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num70[78] = {0x9d,0x1d,0xd8,0x3a,0xd5,0x13,0x7a,0xb1,0xc8,0x86,0xd8,0x31,0xc6,0x6a,0x74,0xac,0x77,0x6c,0xc1,0xf6,0x47,0x4d,0x12,0x5d,0x31,0x24,0xb7,0x73,0x53,0x94,0x13,0xaa,0x90,0xb8,0xc1,0xa1,0x10,0x53,0x16,0xed,0x71,0x03,0xfb,0x73,0x7a,0xdb,0x00,0x22,0x0e,0x68,0x15,0xd7,0x64,0xb5,0x04,0x5c,0xe9,0x74,0x18,0xa0,0xaa,0x40,0x8a,0x64,0xd8,0x33,0x07,0x12,0x90,0x87,0xd8,0x36,0xb4,0x1d,0xed,0x2c,0xde,0xa8};
    std::uint8_t ret70[32] = {0x08,0xdd,0x35,0x36,0x67,0x0c,0x8c,0x68,0xab,0x53,0x3c,0xe8,0x5b,0xc8,0xc9,0x2d,0x17,0xf5,0x2a,0xa1,0xbe,0x5e,0x38,0x8c,0x3b,0x1b,0xc7,0xe2,0x4d,0xb9,0xc4,0x34};
    sm9_bn_mod_n_sub1_ex(ret, num70, 78);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret70, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num71[27] = {0x69,0xca,0xbc,0xbd,0xc3,0x4c,0x2e,0x44,0x7e,0x4d,0x90,0xb6,0x6a,0xc5,0x4c,0xad,0x5b,0x71,0x68,0x9c,0x5f,0x1d,0xde,0x5b,0x47,0x66,0x7f};
    std::uint8_t ret71[32] = {0x00,0x00,0x00,0x00,0x00,0x69,0xca,0xbc,0xbd,0xc3,0x4c,0x2e,0x44,0x7e,0x4d,0x90,0xb6,0x6a,0xc5,0x4c,0xad,0x5b,0x71,0x68,0x9c,0x5f,0x1d,0xde,0x5b,0x47,0x66,0x7f};
    sm9_bn_mod_n_sub1_ex(ret, num71, 27);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret71, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num72[47] = {0x07,0x70,0xde,0x14,0x0e,0xaa,0x0c,0x70,0xd8,0xeb,0x04,0x8b,0x27,0x71,0xe0,0xe4,0x53,0x16,0xba,0xf9,0x23,0x58,0x39,0x20,0x5e,0x77,0x77,0x19,0x3a,0xda,0xf3,0x7e,0x0b,0x7c,0xc8,0xa3,0xaf,0xf2,0xae,0x9f,0xf9,0xc0,0xbe,0xb8,0x0e,0x16,0x42};
    std::uint8_t ret72[32] = {0x14,0xc8,0x23,0xce,0xd5,0x9b,0xee,0x92,0x91,0x41,0x7a,0x91,0x9f,0x35,0x1b,0xb5,0x42,0x62,0x2a,0x22,0x89,0x79,0xa5,0x7b,0x7d,0x75,0x00,0xed,0x74,0x10,0xeb,0x8e};
    sm9_bn_mod_n_sub1_ex(ret, num72, 47);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret72, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num73[26] = {0x43,0x84,0x54,0xaf,0xee,0x40,0x8c,0xe0,0x39,0x64,0xba,0x2a,0x38,0x05,0xc9,0x4a,0x47,0x03,0xf2,0x13,0x91,0x4e,0x2b,0x29,0xa1,0xed};
    std::uint8_t ret73[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x43,0x84,0x54,0xaf,0xee,0x40,0x8c,0xe0,0x39,0x64,0xba,0x2a,0x38,0x05,0xc9,0x4a,0x47,0x03,0xf2,0x13,0x91,0x4e,0x2b,0x29,0xa1,0xed};
    sm9_bn_mod_n_sub1_ex(ret, num73, 26);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret73, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num74[71] = {0x1c,0xbe,0x03,0x39,0x03,0xdd,0x5d,0xf1,0xe1,0x9d,0x32,0xf9,0x36,0x1b,0x38,0x09,0x6c,0x91,0xae,0x90,0xd4,0x60,0x2f,0xf8,0xe4,0x46,0x38,0x31,0xbf,0x61,0x8d,0x28,0x81,0x09,0x67,0x98,0x5b,0x2b,0x3f,0x72,0x5c,0xb0,0x10,0x8f,0xe7,0xda,0xd7,0x2d,0x20,0x15,0x6c,0x48,0xa7,0x58,0x67,0x93,0x04,0x2b,0xbf,0x2c,0x0a,0xe0,0x75,0x4b,0x32,0x1c,0xd4,0xbc,0x82,0x14,0xed};
    std::uint8_t ret74[32] = {0x12,0x71,0x82,0xd6,0x21,0xeb,0x57,0xf6,0x21,0x4f,0x7a,0x1c,0x43,0x81,0x35,0x14,0x20,0x53,0x1f,0xf9,0xb5,0xc5,0xb2,0x87,0x6b,0xe6,0x7f,0xe0,0x2d,0xc9,0x33,0x39};
    sm9_bn_mod_n_sub1_ex(ret, num74, 71);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret74, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num75[21] = {0x64,0xe7,0x5e,0xe7,0x10,0xb2,0x60,0xb4,0x81,0xb3,0x9f,0x5b,0xef,0x7d,0x67,0xfc,0xb6,0x47,0xf2,0x94,0xa3};
    std::uint8_t ret75[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0xe7,0x5e,0xe7,0x10,0xb2,0x60,0xb4,0x81,0xb3,0x9f,0x5b,0xef,0x7d,0x67,0xfc,0xb6,0x47,0xf2,0x94,0xa3};
    sm9_bn_mod_n_sub1_ex(ret, num75, 21);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret75, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num76[79] = {0xe4,0x50,0xc4,0xef,0xff,0xc0,0x0a,0xe8,0x0a,0x21,0xf5,0x71,0x5a,0xac,0x73,0xc9,0x32,0xbf,0x29,0xf5,0x85,0xde,0xdc,0xac,0x73,0x8f,0x63,0xe0,0xbe,0x8f,0x6c,0xde,0x8b,0xff,0xec,0x81,0xc4,0xfa,0x85,0xb1,0x1b,0x2a,0x34,0x9f,0x28,0x12,0x7e,0x66,0x6d,0x24,0xe3,0x5d,0xd5,0xa9,0x3b,0x8d,0x99,0x42,0x43,0x4c,0xaf,0x33,0x41,0x1c,0x50,0x56,0x47,0xc5,0x81,0x6f,0x7e,0x63,0x63,0x30,0xf4,0x86,0x7a,0x10,0x1c};
    std::uint8_t ret76[32] = {0xac,0x1b,0xde,0x65,0x3d,0xa7,0xd3,0xb6,0xa9,0x28,0x8d,0x64,0x48,0xc9,0x3b,0x95,0xe6,0x00,0xc6,0x48,0x8b,0xfd,0xe9,0xcc,0x8d,0xed,0xcb,0x6e,0x60,0x2e,0x78,0xf8};
    sm9_bn_mod_n_sub1_ex(ret, num76, 79);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret76, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num77[85] = {0x30,0x9d,0x44,0x01,0x41,0xa3,0x5e,0xa4,0x8f,0x52,0x2a,0x86,0x57,0x29,0xd9,0x76,0xd2,0x3f,0x8a,0xe0,0x42,0xb8,0xbe,0x1c,0x5b,0xdf,0xe1,0x4d,0x08,0x01,0x6d,0x33,0x10,0xa9,0x06,0x96,0xd7,0x24,0xf3,0xd5,0x8d,0xb7,0xbf,0x3a,0x53,0xf3,0xe8,0x13,0x3d,0xe0,0x82,0x93,0x72,0x1b,0xd1,0x6c,0x6b,0x65,0x34,0x09,0x40,0x21,0x3b,0x9d,0x0b,0xdb,0x2b,0xcb,0x32,0x89,0xf2,0x57,0x57,0x26,0x5f,0x84,0xda,0x26,0xf3,0x0a,0xb7,0x01,0xec,0x29,0xf7};
    std::uint8_t ret77[32] = {0x78,0xa2,0x3c,0x78,0x4b,0xeb,0x9b,0x59,0x44,0x1d,0x31,0x33,0xc2,0xdd,0x35,0x15,0x98,0x47,0x50,0xea,0xb4,0xac,0x1b,0x3e,0xba,0xdf,0xe8,0xfc,0xa1,0xce,0xce,0x63};
    sm9_bn_mod_n_sub1_ex(ret, num77, 85);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret77, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num78[24] = {0x2d,0x84,0x7a,0xba,0xeb,0x02,0xcb,0x38,0x59,0xba,0x2c,0x8f,0x25,0xc4,0x07,0x64,0xba,0x49,0x4f,0xa4,0x38,0x72,0xde,0x59};
    std::uint8_t ret78[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2d,0x84,0x7a,0xba,0xeb,0x02,0xcb,0x38,0x59,0xba,0x2c,0x8f,0x25,0xc4,0x07,0x64,0xba,0x49,0x4f,0xa4,0x38,0x72,0xde,0x59};
    sm9_bn_mod_n_sub1_ex(ret, num78, 24);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret78, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num79[74] = {0x55,0xc2,0x06,0xba,0x80,0xf2,0x9a,0xda,0xe5,0x04,0x14,0x16,0xb0,0x85,0xa4,0x85,0x64,0x0c,0xb5,0xe3,0x75,0x63,0x95,0x84,0x39,0x31,0x98,0x65,0x96,0x4d,0x4b,0x66,0xb9,0x5c,0x49,0xb7,0xc7,0x1c,0xda,0xd2,0xf6,0xab,0x7c,0x51,0x68,0xfd,0xff,0x06,0xef,0xc5,0x3f,0xc6,0xc2,0x5d,0x25,0x29,0xec,0x01,0xfb,0x21,0x9d,0xc7,0x20,0xb3,0xc6,0x38,0x8b,0xfe,0x30,0x46,0x19,0x6f,0xb7,0x9e};
    std::uint8_t ret79[32] = {0x77,0xac,0x95,0x35,0x73,0x93,0x0d,0xf3,0x65,0x9e,0x31,0x4a,0xbf,0x52,0x4c,0xc9,0x1c,0xe2,0xa5,0x86,0x12,0x45,0x6a,0xf0,0xbc,0xce,0xec,0xb4,0xb9,0x69,0xa3,0x8a};
    sm9_bn_mod_n_sub1_ex(ret, num79, 74);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret79, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num80[86] = {0xad,0x66,0x58,0xb7,0x49,0x22,0x74,0xa4,0x10,0xed,0x19,0x58,0x5d,0x91,0x36,0xcd,0xf8,0x63,0x90,0x97,0x88,0xdf,0x8f,0x57,0xca,0xd5,0x92,0xd3,0x6e,0x20,0xf3,0x99,0xd8,0x11,0xbe,0xbe,0xb4,0xb7,0x9b,0x76,0x7b,0x39,0x29,0xfd,0xff,0x4c,0x62,0x89,0x1c,0xa5,0x04,0x1b,0xac,0x39,0x58,0xf3,0xad,0xe9,0x21,0xb9,0x30,0x12,0xee,0xe8,0x0a,0x1e,0x53,0x3c,0xf3,0x8a,0x2f,0xf1,0xc5,0xb2,0xa9,0x87,0xba,0xc0,0x63,0x20,0x5a,0x5b,0x4e,0x29,0xd2,0x88};
    std::uint8_t ret80[32] = {0x90,0xe7,0x81,0xbe,0x2c,0x84,0xe9,0x2a,0x03,0x53,0xf1,0xd9,0x57,0x9d,0x1e,0x9d,0x1d,0x20,0x2d,0xf6,0x40,0x0c,0xf6,0xa3,0x78,0xb7,0xca,0xa8,0x21,0x0b,0xa0,0x9c};
    sm9_bn_mod_n_sub1_ex(ret, num80, 86);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret80, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num81[22] = {0xe7,0xfd,0xf3,0xbb,0xa9,0xb7,0x71,0xb3,0x3f,0x4f,0xab,0x09,0xcf,0x1d,0xc4,0xf4,0x83,0xc2,0x17,0x85,0x31,0xb7};
    std::uint8_t ret81[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0xfd,0xf3,0xbb,0xa9,0xb7,0x71,0xb3,0x3f,0x4f,0xab,0x09,0xcf,0x1d,0xc4,0xf4,0x83,0xc2,0x17,0x85,0x31,0xb7};
    sm9_bn_mod_n_sub1_ex(ret, num81, 22);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret81, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num82[8] = {0x6b,0x8e,0xd2,0xef,0xfc,0xcd,0x0a,0x68};
    std::uint8_t ret82[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6b,0x8e,0xd2,0xef,0xfc,0xcd,0x0a,0x68};
    sm9_bn_mod_n_sub1_ex(ret, num82, 8);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret82, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num83[58] = {0x0f,0xa2,0xc6,0xef,0xf7,0x89,0xaa,0xf7,0x5a,0x50,0x24,0x1a,0x20,0xc3,0xb4,0x0e,0xe9,0x1e,0x14,0x76,0xfb,0xfa,0xfc,0xdf,0x8d,0x44,0x57,0xd7,0xfb,0x9e,0x08,0x03,0xfc,0x33,0xad,0x01,0xad,0x7e,0xb3,0x12,0x0e,0x26,0x13,0x7c,0x10,0xa3,0xb9,0x7c,0x64,0x24,0x53,0xa5,0x24,0x40,0xf0,0x3c,0x5e,0x58};
    std::uint8_t ret83[32] = {0x8e,0x65,0x98,0xd6,0x03,0xbd,0x46,0xc6,0x4e,0x5f,0xe4,0x21,0x4e,0x1d,0x11,0x4c,0xd0,0x03,0x73,0x86,0x4c,0xeb,0x04,0x53,0xbd,0xfc,0x29,0x56,0xba,0xb3,0xa3,0xa4};
    sm9_bn_mod_n_sub1_ex(ret, num83, 58);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret83, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num84[68] = {0x51,0xfd,0x2a,0x55,0xf3,0xdf,0x56,0xfe,0x73,0x84,0x05,0xb0,0x0e,0x9b,0x09,0xd2,0x87,0xd0,0x8b,0x65,0x18,0x7c,0x60,0xa5,0x22,0x36,0x5a,0x54,0xde,0x60,0x9b,0xa1,0xb8,0x09,0x13,0x4a,0xf3,0x9d,0x1c,0xe8,0x4e,0xfe,0x0a,0x20,0x0f,0xb4,0x11,0x04,0xa5,0xc2,0x5f,0x95,0x87,0x65,0x16,0x89,0xee,0x3b,0x80,0x91,0xc0,0xdc,0xd7,0x99,0x23,0x69,0xc8,0x10};
    std::uint8_t ret84[32] = {0x2f,0xcc,0xae,0x1e,0xb7,0xda,0x12,0x01,0xbe,0xdb,0x3f,0xa8,0xde,0xbd,0x00,0xd7,0x00,0x1f,0x44,0x88,0x66,0x13,0x50,0xc8,0xc9,0xf5,0x4a,0x0a,0xf0,0x85,0x26,0x38};
    sm9_bn_mod_n_sub1_ex(ret, num84, 68);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret84, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num85[49] = {0xcc,0x0a,0x43,0xc3,0xa9,0x7f,0x38,0x99,0x6d,0x71,0x62,0x67,0x5b,0xbd,0x01,0x95,0x2a,0xc1,0x52,0x02,0xbe,0xe7,0xee,0x28,0xd5,0x90,0x2e,0x39,0x1c,0xa0,0x58,0x2c,0x44,0xc9,0x9b,0xc3,0xc7,0x5c,0xe1,0x73,0x35,0x1e,0xfb,0x8a,0x66,0x96,0x68,0x95,0xd3};
    std::uint8_t ret85[32] = {0x84,0x1f,0x24,0x2b,0x08,0xc9,0x79,0x7a,0xd2,0x80,0x62,0x3b,0xbd,0xe1,0x30,0xc4,0xcc,0x5d,0xbb,0x4b,0xac,0x95,0x1f,0x5b,0x43,0x0b,0x91,0x33,0xb9,0x36,0xec,0x6f};
    sm9_bn_mod_n_sub1_ex(ret, num85, 49);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret85, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num86[5] = {0xdf,0x6c,0x2f,0xd6,0xa4};
    std::uint8_t ret86[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xdf,0x6c,0x2f,0xd6,0xa4};
    sm9_bn_mod_n_sub1_ex(ret, num86, 5);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret86, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num87[9] = {0x9a,0x11,0xb9,0x9e,0x44,0xaa,0x0e,0x2b,0x4b};
    std::uint8_t ret87[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9a,0x11,0xb9,0x9e,0x44,0xaa,0x0e,0x2b,0x4b};
    sm9_bn_mod_n_sub1_ex(ret, num87, 9);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret87, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num88[12] = {0x90,0xb8,0xfb,0x12,0xfb,0x3e,0x8f,0x06,0x04,0xef,0xd6,0x9b};
    std::uint8_t ret88[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0xb8,0xfb,0x12,0xfb,0x3e,0x8f,0x06,0x04,0xef,0xd6,0x9b};
    sm9_bn_mod_n_sub1_ex(ret, num88, 12);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret88, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num89[68] = {0xa7,0x7f,0x5c,0x1a,0xe9,0x1e,0x86,0xe6,0x5d,0x41,0x7b,0xa8,0x07,0x71,0x6c,0x28,0xd1,0xfe,0x88,0x3b,0x27,0x56,0xc4,0xcd,0x67,0x16,0x55,0xcf,0xf0,0x61,0xcc,0xd2,0x56,0x30,0x46,0xee,0x87,0x57,0x96,0x07,0x5f,0xc0,0xd8,0xe4,0x78,0x3d,0xd9,0xda,0xf4,0xec,0x21,0xf9,0xf6,0x45,0x4f,0xc1,0x15,0x0d,0xa0,0xd2,0x35,0x1a,0x01,0xa3,0xb8,0xdc,0x14,0x42};
    std::uint8_t ret89[32] = {0x6a,0x67,0x94,0xdf,0x05,0xad,0x05,0x1a,0x32,0x6c,0x2c,0x11,0x4f,0x5d,0xed,0xa5,0xcb,0x02,0x65,0xd2,0xcc,0x7f,0x8f,0x3d,0x36,0x78,0x28,0xf6,0x24,0x79,0x4e,0x2e};
    sm9_bn_mod_n_sub1_ex(ret, num89, 68);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret89, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num90[28] = {0xb5,0xc4,0x91,0x4f,0xbc,0xfd,0x82,0xd6,0x5a,0xdc,0x53,0x5e,0x42,0xb8,0x1d,0x17,0x2d,0xb5,0xb4,0x2d,0xcb,0xe5,0x1b,0x31,0x15,0xe1,0x86,0x5a};
    std::uint8_t ret90[32] = {0x00,0x00,0x00,0x00,0xb5,0xc4,0x91,0x4f,0xbc,0xfd,0x82,0xd6,0x5a,0xdc,0x53,0x5e,0x42,0xb8,0x1d,0x17,0x2d,0xb5,0xb4,0x2d,0xcb,0xe5,0x1b,0x31,0x15,0xe1,0x86,0x5a};
    sm9_bn_mod_n_sub1_ex(ret, num90, 28);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret90, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num91[66] = {0x26,0x24,0x31,0x67,0xc5,0xe3,0xf2,0x32,0xca,0x26,0x21,0xeb,0xdd,0x59,0x3c,0xd7,0xc7,0x19,0x24,0x5e,0xf6,0xe5,0x79,0xc5,0x07,0xce,0xbc,0xb2,0x50,0x62,0x5e,0xc4,0xbc,0x3a,0x00,0xb1,0xee,0x6e,0xe6,0x9e,0x14,0x5d,0x3b,0xd9,0xfc,0xce,0xf7,0xa8,0x46,0x9f,0x50,0xba,0x3b,0x50,0x11,0x49,0x08,0x19,0xdf,0xa5,0xe2,0x74,0x0b,0x4c,0x2b,0x61};
    std::uint8_t ret91[32] = {0x67,0xa3,0x96,0x85,0x08,0x4a,0x54,0x47,0x70,0x90,0xbe,0xce,0x81,0x3f,0xfd,0x2e,0xbf,0xeb,0x4d,0xae,0xc8,0xaa,0x60,0x44,0x82,0x12,0x98,0x62,0x5a,0xae,0xed,0xa1};
    sm9_bn_mod_n_sub1_ex(ret, num91, 66);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret91, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num92[43] = {0x59,0xf1,0xdc,0x13,0x92,0x5d,0x8b,0x29,0xc4,0x08,0x36,0x80,0x69,0xc0,0xd3,0x8f,0x68,0xff,0x4a,0xbc,0xc7,0x4d,0x73,0x50,0x10,0xad,0x22,0x11,0x80,0x17,0x80,0x04,0xf9,0x97,0x5b,0x80,0x6e,0x89,0xac,0x5a,0x77,0xdf,0x23};
    std::uint8_t ret92[32] = {0x0c,0x04,0x30,0x13,0xb6,0x63,0xe9,0xcc,0xd7,0xa9,0x54,0xef,0xcf,0xae,0x53,0x1a,0xb6,0xa8,0xec,0xcf,0xbf,0xbc,0xe8,0x0d,0xd7,0x50,0xdf,0x22,0xc3,0x30,0xa9,0x67};
    sm9_bn_mod_n_sub1_ex(ret, num92, 43);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret92, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num93[60] = {0xdf,0xa6,0x28,0x0d,0x0c,0x72,0xe6,0x9c,0x87,0x07,0x01,0xd2,0x8c,0x16,0x85,0x8a,0x94,0xb2,0x46,0x2d,0xc5,0xf0,0xe3,0xac,0x05,0xb0,0xe9,0x01,0x25,0x09,0xd6,0x9d,0x0f,0x3b,0x68,0x4c,0x57,0x12,0xa8,0xa3,0x97,0x37,0xfd,0x62,0x5c,0x6c,0x33,0xc7,0xc6,0xf0,0x2b,0x6f,0x13,0xfa,0x22,0x4a,0xc6,0xd7,0x5d,0xda};
    std::uint8_t ret93[32] = {0x59,0xe8,0x91,0x11,0xf0,0x7f,0x58,0x03,0x3a,0x76,0x1f,0x11,0x4b,0x9e,0xe3,0x41,0xd2,0x20,0xe9,0x5d,0xf3,0xa8,0x4c,0x53,0x75,0x02,0xba,0x58,0x61,0x06,0xce,0x46};
    sm9_bn_mod_n_sub1_ex(ret, num93, 60);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret93, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num94[100] = {0x57,0x31,0x83,0x97,0x8d,0x5c,0x88,0xf6,0xf8,0x65,0x09,0x30,0x26,0x2b,0xc5,0x40,0x5c,0x16,0x89,0xda,0x18,0x49,0xa7,0x48,0x15,0x27,0x8e,0xc9,0x37,0x8d,0xaa,0x80,0x8a,0xd5,0x50,0x86,0x5f,0x92,0x38,0xb4,0xaa,0x89,0x8d,0x9a,0xba,0xc1,0xf9,0x6e,0x9b,0xad,0x4b,0xec,0x39,0xa4,0xcb,0x56,0x57,0xfd,0xe4,0xf1,0xe4,0xbe,0xab,0x53,0x00,0x6f,0x11,0x97,0x9f,0xb8,0xfb,0xcb,0x10,0xc9,0x15,0xc6,0x44,0x17,0x42,0xa6,0x8d,0x2f,0x9b,0x86,0x55,0x05,0x03,0x73,0xf7,0x76,0x79,0x36,0x9d,0x97,0xfc,0xd5,0x38,0xbd,0x15,0xe6};
    std::uint8_t ret94[32] = {0x59,0x94,0x49,0xd7,0x3a,0x36,0x4a,0x32,0x51,0x5d,0x34,0xc2,0xbd,0x0d,0xb2,0xfb,0x5e,0xd0,0x7e,0x8d,0x8a,0x18,0x94,0x9e,0xe1,0x7b,0xd2,0xdd,0x82,0x54,0xb8,0xfe};
    sm9_bn_mod_n_sub1_ex(ret, num94, 100);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret94, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num95[32] = {0x3b,0x89,0x4e,0xd3,0xa7,0x1b,0xcb,0x5e,0x57,0x6c,0x66,0x43,0xa6,0x6b,0x7c,0x79,0xb5,0x0d,0x09,0x6c,0x02,0x50,0x3f,0x8e,0x70,0x3a,0xc0,0x05,0x2a,0xc3,0x23,0x3f};
    std::uint8_t ret95[32] = {0x3b,0x89,0x4e,0xd3,0xa7,0x1b,0xcb,0x5e,0x57,0x6c,0x66,0x43,0xa6,0x6b,0x7c,0x79,0xb5,0x0d,0x09,0x6c,0x02,0x50,0x3f,0x8e,0x70,0x3a,0xc0,0x05,0x2a,0xc3,0x23,0x3f};
    sm9_bn_mod_n_sub1_ex(ret, num95, 32);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret95, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num96[81] = {0xde,0xe2,0x70,0x37,0xa4,0x6c,0xe7,0x38,0xd6,0x51,0xab,0x20,0xa0,0x44,0xab,0x4c,0xa4,0xa2,0xfe,0xa7,0x82,0x8a,0xe8,0x48,0x77,0x1d,0x4e,0xfd,0xa8,0x05,0xe2,0xe3,0xf0,0x8a,0xfa,0xab,0x84,0x13,0x2e,0x13,0x96,0xb1,0x38,0xb5,0x1a,0xad,0xab,0x31,0x10,0xbf,0x0b,0x75,0x36,0xad,0xe8,0xf0,0x27,0x43,0xae,0x52,0xca,0x97,0x54,0x4f,0xd0,0x33,0xe4,0x82,0x60,0x7c,0xaa,0x40,0xd8,0x7b,0xc3,0x35,0x0a,0x5a,0x8f,0x04,0x2b};
    std::uint8_t ret96[32] = {0x18,0x33,0x19,0x6e,0xda,0x15,0x86,0xe7,0x24,0xc7,0x56,0xa1,0x86,0x2b,0xee,0x7e,0x15,0xaa,0x6a,0xf7,0xa0,0x0d,0x11,0xb4,0xbe,0xbb,0x31,0xcc,0x1d,0xf8,0x4b,0x1b};
    sm9_bn_mod_n_sub1_ex(ret, num96, 81);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret96, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num97[35] = {0xce,0xe4,0x2f,0x1a,0x1a,0xda,0x56,0xcd,0xf0,0x41,0x17,0x24,0x5e,0xe7,0x93,0x95,0xc4,0x1a,0x97,0x93,0xb3,0x32,0xf8,0xa6,0xc1,0x14,0x9e,0x0d,0x1e,0x75,0xda,0xf9,0xc5,0x4f,0xed};
    std::uint8_t ret97[32] = {0xa2,0x17,0xdb,0x55,0xa7,0x0e,0x5e,0xe9,0x94,0x30,0x1c,0x3b,0xfc,0x0c,0x5c,0xfc,0x32,0x9e,0x54,0x61,0x67,0xa1,0x28,0x2a,0x26,0xf2,0x59,0xef,0xc1,0xce,0x20,0x6d};
    sm9_bn_mod_n_sub1_ex(ret, num97, 35);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret97, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num98[81] = {0xed,0x63,0xa3,0xe5,0xf6,0x5e,0x8e,0x44,0xd2,0x12,0xac,0x32,0x5e,0x36,0x50,0x69,0x9f,0x8e,0x50,0x80,0x65,0xb0,0x73,0x52,0x2a,0xc3,0x64,0xe0,0x70,0x62,0xba,0xe0,0x0d,0x52,0x4f,0x08,0xd7,0xa7,0x14,0xca,0xab,0x0b,0x15,0xf7,0xd4,0x1c,0x65,0xb0,0x71,0xc2,0x50,0xcb,0xc3,0xc2,0x52,0xd4,0xbb,0x26,0xdc,0x97,0xc9,0xbb,0x14,0xfa,0x0a,0x7c,0x7a,0xa6,0x7a,0xa5,0x00,0x12,0x28,0x88,0x40,0xe2,0x05,0xe8,0xa6,0xb7,0xd2};
    std::uint8_t ret98[32] = {0x84,0x5a,0x80,0x00,0xb6,0x2f,0x7f,0xf0,0x11,0x99,0x17,0x7d,0x7a,0xba,0x18,0x11,0x5d,0x34,0x99,0xbf,0xe7,0x8a,0xb7,0xaf,0x9b,0x3d,0xf9,0x28,0x59,0x39,0x56,0x16};
    sm9_bn_mod_n_sub1_ex(ret, num98, 81);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret98, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }

    std::uint8_t num99[91] = {0xf2,0xea,0xa2,0x02,0x58,0x33,0xe7,0x38,0x5b,0xd5,0x6e,0x09,0xcb,0x2e,0x74,0x11,0x6e,0xa3,0xa2,0x30,0x45,0x94,0xe5,0xc6,0x3f,0x67,0xf0,0xaa,0xd2,0xf5,0x0e,0xf9,0xaf,0xe1,0x8f,0xc8,0x8f,0x93,0x63,0x98,0x3c,0xce,0x90,0x33,0x17,0x00,0xf2,0x05,0x85,0xae,0x74,0x0b,0xbe,0x8f,0xb8,0xd6,0x6a,0xfc,0x32,0xc6,0x9b,0x61,0x0d,0xd3,0xde,0x1c,0xd0,0xc1,0x5f,0x31,0x3f,0x2a,0x3d,0x55,0xc2,0x57,0xee,0x97,0xbd,0x80,0x0f,0x6c,0x02,0xa4,0x3e,0x76,0xf0,0xc6,0xc9,0x32,0x35};
    std::uint8_t ret99[32] = {0x89,0xf8,0xc9,0xad,0xe9,0x09,0x2b,0x96,0xcc,0xae,0x80,0x8b,0xb4,0x14,0x14,0x74,0x81,0xff,0x19,0x35,0xf7,0xea,0x6c,0x38,0xcb,0xee,0xed,0xfd,0x72,0x07,0x46,0x11};
    sm9_bn_mod_n_sub1_ex(ret, num99, 91);
    sm9_bn_to_bytes(ret_data, ret);
    if (std::memcmp(ret99, ret_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_bn_mod_n_sub1_ex");
    }
}